<?php
/**
 * CreateUser: zlh
 * CreateTime: 2022/2/7 17:05
 * Remark:
 */

namespace App\Enum\EnterpriseEnum;

use App\Enum\BaseEnumInterface;

class EnterpriseStatusEnum implements BaseEnumInterface
{
    // 1：存续；2：注销；3：吊销；4：撤销，5：迁出，6：设立中，7：清算中，8：停业，9：其他
    // 存续
    const EXISTENT_ENTERPRISE_STATUS = 1;
    // 注销
    const REMOVAL_ENTERPRISE_STATUS = 2;
    // 吊销
    const REVOKE_ENTERPRISE_STATUS = 3;
    // 撤销
    const REPEAL_ENTERPRISE_STATUS = 4;
    // 迁出
    const QUIT_ENTERPRISE_STATUS = 5;
    // 设立中
    const SET_ENTERPRISE_STATUS = 6;
    // 清算中
    const CLEAR_ENTERPRISE_STATUS = 7;
    // 停业
    const CLOSE_ENTERPRISE_STATUS = 8;
    // 其他
    const REST_ENTERPRISE_STATUS = 9;

    public static function getEnumMeaningByEnumCode($enumCode)
    {
        switch ($enumCode){
            case self::EXISTENT_ENTERPRISE_STATUS:
                return "存续";
            case self::REMOVAL_ENTERPRISE_STATUS:
                return "注销";
            case self::REVOKE_ENTERPRISE_STATUS:
                return "吊销";
            case self::REPEAL_ENTERPRISE_STATUS:
                return "撤销";
            case self::QUIT_ENTERPRISE_STATUS:
                return "迁出";
            case self::SET_ENTERPRISE_STATUS:
                return "设立中";
            case self::CLEAR_ENTERPRISE_STATUS:
                return "清算中";
            case self::CLOSE_ENTERPRISE_STATUS:
                return "停业";
            default:
                return "未知";
        }
    }

    public static function getEnumCodeByMeaning($meaning): int
    {
        switch ($meaning){
            case "存续":
                return self::EXISTENT_ENTERPRISE_STATUS;
            case "注销":
                return self::REMOVAL_ENTERPRISE_STATUS;
            case "吊销":
                return self::REVOKE_ENTERPRISE_STATUS;
            case "撤销":
                return self::REPEAL_ENTERPRISE_STATUS;
            case "迁出":
                return self::QUIT_ENTERPRISE_STATUS;
            case "设立中":
                return self::SET_ENTERPRISE_STATUS;
            case "清算中":
                return self::CLEAR_ENTERPRISE_STATUS;
            case "停业":
                return self::CLOSE_ENTERPRISE_STATUS;
            default:
                return self::REST_ENTERPRISE_STATUS;
        }
    }

}